﻿using System;
using Mono.Cecil.Metadata;

namespace Mono.Cecil
{
	// Token: 0x020000A6 RID: 166
	public sealed class RequiredModifierType : TypeSpecification, IModifierType
	{
		// Token: 0x17000199 RID: 409
		// (get) Token: 0x0600068E RID: 1678 RVA: 0x000215AC File Offset: 0x0001F7AC
		// (set) Token: 0x0600068F RID: 1679 RVA: 0x0000464E File Offset: 0x0000284E
		public TypeReference ModifierType
		{
			get
			{
				return this.modifier_type;
			}
			set
			{
				this.modifier_type = value;
			}
		}

		// Token: 0x1700019A RID: 410
		// (get) Token: 0x06000690 RID: 1680 RVA: 0x000215C4 File Offset: 0x0001F7C4
		public override string Name
		{
			get
			{
				return base.Name + this.Suffix;
			}
		}

		// Token: 0x1700019B RID: 411
		// (get) Token: 0x06000691 RID: 1681 RVA: 0x000215E8 File Offset: 0x0001F7E8
		public override string FullName
		{
			get
			{
				return base.FullName + this.Suffix;
			}
		}

		// Token: 0x1700019C RID: 412
		// (get) Token: 0x06000692 RID: 1682 RVA: 0x0002160C File Offset: 0x0001F80C
		private string Suffix
		{
			get
			{
				string str = " modreq(";
				TypeReference typeReference = this.modifier_type;
				return str + ((typeReference != null) ? typeReference.ToString() : null) + ")";
			}
		}

		// Token: 0x1700019D RID: 413
		// (get) Token: 0x06000693 RID: 1683 RVA: 0x00009C40 File Offset: 0x00007E40
		// (set) Token: 0x06000694 RID: 1684 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public override bool IsValueType
		{
			get
			{
				return false;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x1700019E RID: 414
		// (get) Token: 0x06000695 RID: 1685 RVA: 0x0000A3A0 File Offset: 0x000085A0
		public override bool IsRequiredModifier
		{
			get
			{
				return true;
			}
		}

		// Token: 0x1700019F RID: 415
		// (get) Token: 0x06000696 RID: 1686 RVA: 0x00021640 File Offset: 0x0001F840
		public override bool ContainsGenericParameter
		{
			get
			{
				return this.modifier_type.ContainsGenericParameter || base.ContainsGenericParameter;
			}
		}

		// Token: 0x06000697 RID: 1687 RVA: 0x00021668 File Offset: 0x0001F868
		public RequiredModifierType(TypeReference modifierType, TypeReference type) : base(type)
		{
			bool flag = modifierType == null;
			if (flag)
			{
				throw new ArgumentNullException(Mixin.Argument.modifierType.ToString());
			}
			Mixin.CheckType(type);
			this.modifier_type = modifierType;
			this.etype = Mono.Cecil.Metadata.ElementType.CModReqD;
		}

		// Token: 0x040001DC RID: 476
		private TypeReference modifier_type;
	}
}
